package com.bdqn.t382.lx;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

@Component
public class Printer {
    @Resource(name = "a4Paper")
    private Paper paper;
    @Resource(name = "colorInkBox")
    private InkBox inkBox;

    public Printer() {
    }

    public Printer(Paper paper) {
        this.paper = paper;
    }

    public Printer(Paper paper, InkBox inkBox) {
        this.paper = paper;
        this.inkBox = inkBox;
    }

    public Paper getPaper() {
        return paper;
    }

    public void setPaper(Paper paper) {
        this.paper = paper;
    }

    public InkBox getInkBox() {
        return inkBox;
    }

    public void setInkBox(InkBox inkBox) {
        this.inkBox = inkBox;
    }

    public void print() {
        System.out.println("这是一个" + paper.size() + "大小的" + inkBox
                .color() + "墨盒");
    }
}
